"use client"
import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';
import {
  DatePicker,
  Form,
  Input,
  Switch,
} from 'antd';


type Iprops = {
  title: string,
  itemobj: any,
  handleCancel: () => void
}

const Mytype = (props: Iprops) => {
  const [form] = Form.useForm();
  const router = useRouter()
  useEffect(() => {
    if (props.title == '详情') {
      form.setFieldsValue(props.itemobj)
    }
  })

  return (
    <>
      <Form
        form={form}
        labelCol={{ span: 4 }}
        wrapperCol={{ span: 14 }}
        style={{ maxWidth: 600 }}
      >
        <Form.Item label="订单编号" name="idname">
          <Input />
        </Form.Item>
        <Form.Item label="订单标题" name="name">
          <Input />
        </Form.Item>
        <Form.Item label="关联客户" name="address">
          <Input />
        </Form.Item>
        <Form.Item label="订单总金额" name="age">
          <Input />
        </Form.Item>
        <Form.Item label="审批类型" name="Collect">
          <Switch />
        </Form.Item>
        <Form.Item label="创建人员" name="title">
          <Input />
        </Form.Item>
        <Form.Item label="提交时间" name="time">
          <Input />
        </Form.Item>
      </Form>
    </>
  );
};

export default Mytype;